package cn.edu.nwpu.warehousemanagement.pojo.request;

import jakarta.validation.constraints.Pattern;
import lombok.Data;


/**
 * 注册请求类，定义一下前端传来的接口
 *
 * @author Loadstar
 * @version 1.0
 */
@Data
public class RegisterRequest {
    @Pattern(regexp = "^\\S{5,20}$")
    String username;
    String password;
    @Pattern(regexp = "^\\S{1,16}$")
    String realname;
    @Pattern(regexp = "^1[3-9]\\d{9}$")
    String phone;
    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$")
    String email;
    @Pattern(regexp = "^(ADMIN|WAREHOUSE_MGR|BUYER|COURIER)$")
    String role;

}
